package com.lyl.domaindemo.domain.user;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lyl
 * @date 2023/5/17
 */

@Service
public class UserService {

    private final UserServiceRepository userServiceRepository;

    public UserService(UserServiceRepository userServiceRepository) {
        this.userServiceRepository = userServiceRepository;
    }

    public Page<User> getUsers(Pageable pageable) {
        return userServiceRepository.getUsers(pageable);
    }

    public void saveUser(User user) {
        userServiceRepository.saveUser(user);
    }

    public void deleteUser(List<Long> ids) {
        userServiceRepository.deleteUser(ids);
    }
}
